Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Editing Simple Polygons

QuickDraw 3D provides routines that you can use to create and manipulate simple polygons. See "Simple Polygons" for the definition of a simple polygon.

Q3Polygon_New

You can use the Q3Polygon_New function to create a new simple polygon.

TQ3GeometryObject Q3Polygon_New (
                     const TQ3PolygonData *polygonData);
polygonData
A pointer to a TQ3PolygonData structure.

DESCRIPTION

The Q3Polygon_New function returns, as its function result, a new simple polygon having the vertices and attributes specified by the polygonData parameter. If a new simple polygon could not be created, Q3Polygon_New returns the value NULL .

Q3Polygon_Submit

You can use the Q3Polygon_Submit function to submit an immediate simple polygon for drawing, picking, bounding, or writing.

TQ3Status Q3Polygon_Submit (
                     const TQ3PolygonData *polygonData,
                     TQ3ViewObject view);
polygonData
A pointer to a TQ3PolygonData structure.
view
A view.

DESCRIPTION

The Q3Polygon_Submit function submits for drawing, picking, bounding, or writing the immediate simple polygon whose shape and attribute set are specified by the polygonData parameter. The simple polygon is drawn, picked, bounded, or written according to the view characteristics specified in the view parameter.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3Polygon_GetData

You can use the Q3Polygon_GetData function to get the data that defines a simple polygon and its attributes.

TQ3Status Q3Polygon_GetData (
                     TQ3GeometryObject polygon,
                     TQ3PolygonData *polygonData);
polygon
A simple polygon.
polygonData
On exit, a pointer to a TQ3PolygonData structure that contains information about the simple polygon specified by the polygon parameter.

DESCRIPTION

The Q3Polygon_GetData function returns, through the polygonData parameter, information about the simple polygon specified by the polygon parameter. QuickDraw 3D allocates memory for the TQ3PolygonData structure internally; you must call Q3Polygon_EmptyData to dispose of that memory.

Q3Polygon_SetData

You can use the Q3Polygon_SetData function to set the data that defines a simple polygon and its attributes.

TQ3Status Q3Polygon_SetData (
                     TQ3GeometryObject polygon,
                     const TQ3PolygonData *polygonData);
polygon
A simple polygon.
polygonData
A pointer to a TQ3PolygonData structure.

DESCRIPTION

The Q3Polygon_SetData function sets the data associated with the simple polygon specified by the polygon parameter to the data specified by the polygonData parameter.

Q3Polygon_EmptyData

You can use the Q3Polygon_EmptyData function to release the memory occupied by the data structure returned by a previous call to Q3Polygon_GetData .

TQ3Status Q3Polygon_EmptyData (TQ3PolygonData *polygonData);
polygonData
A pointer to a TQ3PolygonData structure.

DESCRIPTION

The Q3Polygon_EmptyData function releases the memory occupied by the TQ3PolygonData structure pointed to by the polygonData parameter; that memory was allocated by a previous call to Q3Polygon_GetData .

Q3Polygon_GetVertexPosition

You can use the Q3Polygon_GetVertexPosition function to get the position of a vertex of a simple polygon.

TQ3Status Q3Polygon_GetVertexPosition (
                     TQ3GeometryObject polygon,
                     unsigned long index,
                     TQ3Point3D *point);
polygon
A simple polygon.
index
An index into the vertices array of the specified simple polygon.
point
On exit, the position of the specified vertex.

DESCRIPTION

The Q3Polygon_GetVertexPosition function returns, in the point parameter, the position of the vertex having the index specified by the index parameter in the vertices array of the simple polygon specified by the polygon parameter.

Q3Polygon_SetVertexPosition

You can use the Q3Polygon_SetVertexPosition function to set the position of a vertex of a simple polygon.

TQ3Status Q3Polygon_SetVertexPosition (
                     TQ3GeometryObject polygon,
                     unsigned long index,
                     const TQ3Point3D *point);
polygon
A simple polygon.
index
An index into the vertices array of the specified simple polygon.
point
The desired position of the specified vertex.

DESCRIPTION

The Q3Polygon_SetVertexPosition function sets the position of the vertex having the index specified by the index parameter in the vertices array of the simple polygon specified by the polygon parameter to that specified in the point parameter.

Q3Polygon_GetVertexAttributeSet

You can use the Q3Polygon_GetVertexAttributeSet function to get the attribute set of a vertex of a simple polygon.

TQ3Status Q3Polygon_GetVertexAttributeSet (
                     TQ3GeometryObject polygon,
                     unsigned long index,
                     TQ3AttributeSet *attributeSet);
polygon
A simple polygon.
index
An index into the vertices array of the specified simple polygon.
attributeSet
On exit, a pointer to a vertex attribute set for the specified vertex.

DESCRIPTION

The Q3Polygon_GetVertexAttributeSet function returns, in the attributeSet parameter, the set of attributes for the vertex having the index specified by the index parameter in the vertices array of the simple polygon specified by the polygon parameter. The reference count of the set is incremented.

Q3Polygon_SetVertexAttributeSet

You can use the Q3Polygon_SetVertexAttributeSet function to set the attribute set of a vertex of a simple polygon.

TQ3Status Q3Polygon_SetVertexAttributeSet (
                     TQ3GeometryObject polygon,
                     unsigned long index,
                     TQ3AttributeSet attributeSet);
polygon
A simple polygon.
index
An index into the vertices array of the specified simple polygon.
attributeSet
The desired set of attributes for the specified vertex.

DESCRIPTION

The Q3Polygon_SetVertexAttributeSet function sets the attribute set of the vertex having the index specified by the index parameter in the vertices array of the simple polygon specified by the polygon parameter to the set specified in the attributeSet parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |